if condition: Statements ---------- else: Statements ---------- next statements
a=input("Enter a Number ") a=int(a) if a%2==0: print("Number is Even") else: print("Number is Odd")
Enter a Number: 24 Number is EVEN
a,b,c=input("Enter 3 Angles").split() a,b,c=int(a),int(b),int(c) if a+b+c==180 : print("Triangle can be formed") else: print("Triangle can not be formed")
Enter 3 Angles: 30 100 50 Triangle can be formed
a=input("Enter a Number: ") a=int(a) if a>=10 and a<=99: print("2 digit Number") else: print("Not a 2 digit Number")
Enter a no.: 15 2 digit Number
a=input("Enter a Number: ") a=int(a) if a>=10 and a<=99: print("2 digit Number") x=a%10 y=a//10 s=x+y print("Sum of digits is ",s) else: print("Not a 2 digit Number")
Enter a no.: 15 2 digit Number Sum of digit is 6